﻿package com.d4p.util
{
	import flash.display.Sprite;

	public class ThousandString extends Sprite
	{
		public static function thousand( _value:uint ):String
		{
			var str:String; 
			
			if(_value>999999999){
				str = String(_value).substring(0, String(_value).length-9)+","+String(_value).substring(String(_value).length-9, String(_value).length-6)+","+String(_value).substring(String(_value).length-6, String(_value).length-3)+","+String(_value).substring(String(_value).length-3, String(_value).length);
				
				return str;
			}else if(_value>999999){
				str = String(_value).substring(0, String(_value).length-6)+","+String(_value).substring(String(_value).length-6, String(_value).length-3)+","+String(_value).substring(String(_value).length-3, String(_value).length);
				
				return str;
			}else if(_value>999){
				str = String(_value).substring(0, String(_value).length-3)+","+String(_value).substring(String(_value).length-3, String(_value).length);
				
				return str;
			}else{
				return String(_value);
			}
		}
		
		public function ThousandString()
		{
		}
		
		
	}
}
